'use strict';
const Controller = require('egg').Controller;
class LyController extends Controller {
    //最受欢迎 ？？需要改
    async fenleitop() { 
        let page1 = this.ctx.request.url;
        let num = page1.match(/(?<==).*/g);
        this.ctx.body = await this.ctx.service.ly.fenleitop(num);
       
    }
    //新秀菜谱
    async xinxiu(page){
        let page1 = this.ctx.request.url;
        let num = page1.match(/(?<==).*/g);
        this.ctx.body = await this.ctx.service.ly.xinxiu(num);
    }
    //所有菜单
    async allcaidan(){
        this.ctx.body = await this.ctx.service.ly.allcaidan();
    }
    //往期头条
    async wangqitop(){
        let page1 = this.ctx.request.url;
        let num = page1.match(/(?<==).*/g);
        this.ctx.body = await this.ctx.service.ly.wangqitop(num);

    }
    //厨房101
    async chufang101(){
        let page1 = this.ctx.request.url;
        let num = page1.match(/(?<==).*/g);
        this.ctx.body = await this.ctx.service.ly.chufang101(num);

    }
    async popcaidan(){
        this.ctx.body = await this.ctx.service.ly.popcaidan();

    }
    async caishitiaozhuan(){
        let zhhid = this.ctx.request.url;
        let num = zhhid.match(/(?<==).*/g);
        this.ctx.body = await this.ctx.service.ly.caishitiaozhuan(num);
    }

    async lydishes(){
        let type = this.ctx.query.type;
        console.log(type);
        this.ctx.body = await this.ctx.service.ly.lydishes(type);

    }
}
module.exports = LyController;